package com.jiazhong.text;

import java.util.Scanner;

public class Test11 {
    public static void main(String[] args) {
        int number = (int) (Math.random() * 100);
        int counter = 1;
        boolean flag = false;
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你猜的数字");
        int guess = scanner.nextInt();
        for (counter = 1; counter <= 20; counter++) {
            if (guess > number)
                System.out.println("再小一些");
            if (guess < number)
                System.out.println("再大一些");
            if (guess == number)
                break;
            if (counter<20){
                System.out.println("请输入你猜的数字");
                guess = scanner.nextInt();
            }
        }
        if (counter>20){
            System.out.println("对不起您的次数已经用完");
            return;
        }
        switch (counter){
            case 1:
                System.out.println("你简直就是小天才");
                break;
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
                System.out.println("小东西尚需努力");
                break;
            default:
                System.out.println("你真是个小白痴");
        }
    }

}
